package com.msb.projo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Book {
    @Value("1234")
    private String id;
    @Value("python")
    private String name;

    @Autowired
    private Boy boy;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        System.out.println("id的setter方法");
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        System.out.println("name的setter方法");
        this.name = name;
    }

    public Boy getBoy() {
        return boy;
    }

    public void setBoy(Boy boy) {
        this.boy = boy;
    }

    public Book(){
        System.out.println("Book类空构造器");
    }
    public Book(String id, String name) {
        this.id = id;
        this.name = name;
    }
}
